
import requests
import datetime
import time
import json
import pandas as pd

url ='https://index.baidu.com/api/SearchApi/index?area=0&word=[[%7B%22name%22:%22%E5%90%89%E5%88%A9%E6%B1%BD%E8%BD%A6%22,%22wordType%22:1%7D]]&startDate=2021-03-04&endDate=2021-04-18'
headers={
        #'User-agent':str(UserAgent(verify_ssl=False).random),
        'User-agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36',
        'Cookie':'BIDUPSID=089F24122BED546292694B6349959468; PSTM=1617067894; BAIDUID=10E5BEB033DB8938F7C134F1098A1E1B:FG=1; __yjs_duid=1_fcea84e10587db94d7c6b4d5ac6eb3f41617342489912; BDUSS=BOTTdhRW5samU5aG50QVhnd2RKdWJsa3ZFVGtpdDlPbWNINFFtemhGeHp5cE5nRVFBQUFBJCQAAAAAAAAAAAEAAABc7HISMjk2ODE1MTgwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHM9bGBzPWxgVT; BDUSS_BFESS=BOTTdhRW5samU5aG50QVhnd2RKdWJsa3ZFVGtpdDlPbWNINFFtemhGeHp5cE5nRVFBQUFBJCQAAAAAAAAAAAEAAABc7HISMjk2ODE1MTgwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHM9bGBzPWxgVT; BCLID_BFESS=11676696386172517960; BDSFRCVID_BFESS=rT4OJeC624ylft7efeonUZE2NfNivH3TH6aoHm4TMlx-30-maDoEEG0P8M8g0KubM9GjogKKKgOTHIDF_2uxOjjg8UtVJeC6EG0Ptf8g0f5; H_BDCLCKID_SF_BFESS=tJ-qVIL2JC_3fP36qR5h-t6HhxoJq5kD3gOZ0l8Kttoxjqn--4okb-AN3J64Jf6hBCDHXfjmWIQHDpRILpJhbxulDUQR2U7B3IJ4KKJxQtPWeIJo5t5lD-CY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; RT="z=1&dm=baidu.com&si=afzredhgeps&ss=knnxtcvg&sl=8&tt=905&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf"; Hm_lpvt_d101ea4d2a5c67dab98251f0b5de24dc=1618796912',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'zh-CN,zh;q=0.9',
        'Host':'index.baidu.com',
        'Referer':'https://index.baidu.com/v2/main/index.html',
        'Connection':'keep-alive',
        'Accept':'application/json, text/plain, */*',
    }

print(requests.get(url,headers =headers).text)